#ifndef __TYPES_H_
#define __TYPES_H_

#define NULL ((void *)0)
#define PGSIZE 4096
#define USTACK_SIZE 4096
#define SECSIZE 512

#define ROUNDUP(base, multiple) ((base) + multiple - (base) % multiple)
#define ROUNDDOWN(base, multiple) (base - base % multiple)

typedef char int8;
typedef short int16;
typedef int int32;
typedef long int64;

typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;

// for transplanted libs
typedef uint8 uint8_t;
typedef uint16 uint16_t;
typedef uint32 uint32_t;
typedef uint64 uint64_t;
typedef int8 int8_t;
typedef int16 int16_t;
typedef int32 int32_t;
typedef int64 int64_t;

typedef uint64 size_t;
typedef int64 ssize_t;

typedef uint64_t uintptr_t;

#endif
